projects
/
project
/
ubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68da4ce
)
libubus: add null for ubus_context object in ubus_shutdown()
author
Alexandru Ardelean
<
[email protected]
>
Thu, 17 Dec 2015 08:45:22 +0000
(10:45 +0200)
committer
Felix Fietkau
<
[email protected]
>
Sat, 19 Dec 2015 11:29:23 +0000
(12:29 +0100)
At the moment, we do our own null checks before calling ubus_free().
The likely-hood of 'ctx' being null (in ubus_free()) is low,
but since free() handles null, might make sense for ubus_free() to do so as well.
Signed-off-by: Alexandru Ardelean <
[email protected]
>
libubus.c
patch
|
blob
|
history
diff --git
a/libubus.c
b/libubus.c
index bfbaeb6565905f2614e202fc8c25d265fd1ca52c..d52faff9d9cd11b573584268df21f776b6fbe379 100644
(file)
--- a/
libubus.c
+++ b/
libubus.c
@@
-358,6
+358,8
@@
struct ubus_context *ubus_connect(const char *path)
void ubus_shutdown(struct ubus_context *ctx)
{
blob_buf_free(&b);
+ if (!ctx)
+ return;
close(ctx->sock.fd);
free(ctx->msgbuf.data);
}